import 'package:flutter/material.dart';
import 'package:fzcgx_app/common/adapter_utils.dart';
import 'package:fzcgx_app/common/assets_utils.dart';
import 'package:fzcgx_app/provider/provider_widget.dart';
import 'package:fzcgx_app/ui/base/base_view_model.dart';
import 'package:fzcgx_app/ui/my/worker/view_model/worker_education_background_view_model.dart';
import 'package:fzcgx_app/ui/widget/custom_appbar_widget.dart';

class WorkerObjectFactoryPage extends StatefulWidget {
  WorkerObjectFactoryPage({Key key}) : super(key: key);

  @override
  _WorkerObjectFactoryPageState createState() => _WorkerObjectFactoryPageState();
}

class _WorkerObjectFactoryPageState extends State<WorkerObjectFactoryPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: CustomAppbar(
        title: '求职意向（工厂）'
      ),
      body: SafeArea(
          child: ProviderWidget<WorkerEducationBackgroundViewModel>(
        model: WorkerEducationBackgroundViewModel(),
        onReady: (viewModel) {
          viewModel.requestApi();
        },
        builder: (context, viewModel, child) {
          return SingleChildScrollView(
            child: viewModel.state == ViewState.Success
                ? _buildSuccessWidget(viewModel)
                : Container(),
          );
        },
      )),
    );
  }

  Widget _buildSuccessWidget(WorkerEducationBackgroundViewModel viewModel) {
    return Container(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          SizedBox(
            height: AdapterUtils.getHeight(4),
          ),
          Container(
            height: AdapterUtils.getHeight(38),
            color: Color(0xffEAF7FE),
            child: Center(
              child: Text(
                '注册填写/上传的信息越全面，客户信任度越高',
                style: TextStyle(
                  fontSize: AdapterUtils.getSp(13),
                  color: Color(0xff15A1FF),
                  fontWeight: FontWeight.w500,
                ),
              ),
            ),
          ),
          SizedBox(
            height: AdapterUtils.getHeight(28),
          ),
          Container(
            margin: EdgeInsets.symmetric(horizontal: AdapterUtils.getWidth(15)),
            child: Text(
              '添加求职意向',
              style: TextStyle(
                fontSize: AdapterUtils.getSp(18),
                color: Color(0xff141F33),
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
          SizedBox(
            height: AdapterUtils.getHeight(16),
          ),
          Container(
            margin: EdgeInsets.symmetric(horizontal: AdapterUtils.getWidth(15)),
            child: Text(
              '请选择，选择不上限',
              style: TextStyle(
                fontSize: AdapterUtils.getSp(13),
                color: Color(0xff99A2AD),
                fontWeight: FontWeight.w500,
              ),
            ),
          ),
          SizedBox(
            height: AdapterUtils.getHeight(40),
          ),
          Container(
            margin: EdgeInsets.symmetric(horizontal: AdapterUtils.getWidth(15)),
            child: Text(
              '面料种类',
              style: TextStyle(
                fontSize: AdapterUtils.getSp(16),
                color: Color(0xff3B4859),
                fontWeight: FontWeight.w500,
              ),
            ),
          ),
          
           SizedBox(
            height: AdapterUtils.getHeight(24),
          ),
           Container(
                width: AdapterUtils.screenWidth(),
                height: AdapterUtils.getHeight(50),
                 margin: EdgeInsets.all(15),
                child: FlatButton(
                    onPressed:  () {
                    //  viewModel.onPostApi(context);
                    },
                    disabledColor: Color(0xff15A1FF).withAlpha(80),
                    color: Color(0xff15A1FF),
                    shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.all(Radius.circular(4)),
                    ),
                    child: Text(
                      '保存',
                      style: TextStyle(
                        fontSize: AdapterUtils.getSp(16),
                        color: Colors.white,
                        fontWeight: FontWeight.w500,
                      ),
                    ))),
            SizedBox(
              height: AdapterUtils.getHeight(16),
            ),
        ],
      ),
    );
  }
}
